Optimal. Leaf size=74 \[ \frac {3 i x}{2 a}-\frac {\log (\cos (c+d x))}{a d}-\frac {3 i \tan (c+d x)}{2 a d}-\frac {\tan ^2(c+d x)}{2 d (a+i a \tan (c+d x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 74, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {3631, 3606,
3556} \begin {gather*} -\frac {\tan ^2(c+d x)}{2 d (a+i a \tan (c+d x))}-\frac {3 i \tan (c+d x)}{2 a d}-\frac {\log (\cos (c+d x))}{a d}+\frac {3 i x}{2 a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3556
Rule 3606
Rule 3631
Rubi steps
\begin {align*} \int \frac {\tan ^3(c+d x)}{a+i a \tan (c+d x)} \, dx &=-\frac {\tan ^2(c+d x)}{2 d (a+i a \tan (c+d x))}+\frac {\int \tan (c+d x) (2 a-3 i a \tan (c+d x)) \, dx}{2 a^2}\\ &=\frac {3 i x}{2 a}-\frac {3 i \tan (c+d x)}{2 a d}-\frac {\tan ^2(c+d x)}{2 d (a+i a \tan (c+d x))}+\frac {\int \tan (c+d x) \, dx}{a}\\ &=\frac {3 i x}{2 a}-\frac {\log (\cos (c+d x))}{a d}-\frac {3 i \tan (c+d x)}{2 a d}-\frac {\tan ^2(c+d x)}{2 d (a+i a \tan (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(174\) vs. \(2(74)=148\).
time = 1.24, size = 174, normalized size = 2.35 \begin {gather*} -\frac {i \cos (c) \sec (c+d x) (\cos (d x)+i \sin (d x)) \left (-6 d x-2 i \log \left (\cos ^2(c+d x)\right )+4 d x \sec ^2(c)+4 \sec (c) \sec (c+d x) \sin (d x)+\sin (2 d x)+\text {ArcTan}(\tan (d x)) (-4-4 i \tan (c))-2 i d x \tan (c)+2 \log \left (\cos ^2(c+d x)\right ) \tan (c)+4 i \sec (c) \sec (c+d x) \sin (d x) \tan (c)-i \sin (2 d x) \tan (c)-4 d x \tan ^2(c)+\cos (2 d x) (i+\tan (c))\right )}{4 d (a+i a \tan (c+d x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.10, size = 56, normalized size = 0.76
method | result | size |
derivativedivides | \(\frac {-i \tan \left (d x +c \right )-\frac {i}{2 \left (\tan \left (d x +c \right )-i\right )}+\frac {5 \ln \left (\tan \left (d x +c \right )-i\right )}{4}-\frac {\ln \left (\tan \left (d x +c \right )+i\right )}{4}}{d a}\) | \(56\) |
default | \(\frac {-i \tan \left (d x +c \right )-\frac {i}{2 \left (\tan \left (d x +c \right )-i\right )}+\frac {5 \ln \left (\tan \left (d x +c \right )-i\right )}{4}-\frac {\ln \left (\tan \left (d x +c \right )+i\right )}{4}}{d a}\) | \(56\) |
risch | \(\frac {5 i x}{2 a}+\frac {{\mathrm e}^{-2 i \left (d x +c \right )}}{4 d a}+\frac {2 i c}{d a}+\frac {2}{d a \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}-\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d a}\) | \(77\) |
norman | \(\frac {\frac {1}{2 d a}+\frac {3 i x}{2 a}+\frac {3 i x \left (\tan ^{2}\left (d x +c \right )\right )}{2 a}-\frac {3 i \tan \left (d x +c \right )}{2 d a}-\frac {i \left (\tan ^{3}\left (d x +c \right )\right )}{d a}}{1+\tan ^{2}\left (d x +c \right )}+\frac {\ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2 d a}\) | \(97\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.38, size = 93, normalized size = 1.26 \begin {gather*} \frac {10 i \, d x e^{\left (4 i \, d x + 4 i \, c\right )} + {\left (10 i \, d x + 9\right )} e^{\left (2 i \, d x + 2 i \, c\right )} - 4 \, {\left (e^{\left (4 i \, d x + 4 i \, c\right )} + e^{\left (2 i \, d x + 2 i \, c\right )}\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 1}{4 \, {\left (a d e^{\left (4 i \, d x + 4 i \, c\right )} + a d e^{\left (2 i \, d x + 2 i \, c\right )}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.21, size = 114, normalized size = 1.54 \begin {gather*} \begin {cases} \frac {e^{- 2 i c} e^{- 2 i d x}}{4 a d} & \text {for}\: a d e^{2 i c} \neq 0 \\x \left (\frac {\left (5 i e^{2 i c} - i\right ) e^{- 2 i c}}{2 a} - \frac {5 i}{2 a}\right ) & \text {otherwise} \end {cases} + \frac {2}{a d e^{2 i c} e^{2 i d x} + a d} + \frac {5 i x}{2 a} - \frac {\log {\left (e^{2 i d x} + e^{- 2 i c} \right )}}{a d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.73, size = 70, normalized size = 0.95 \begin {gather*} -\frac {\frac {\log \left (\tan \left (d x + c\right ) + i\right )}{a} - \frac {5 \, \log \left (-i \, \tan \left (d x + c\right ) - 1\right )}{a} + \frac {4 i \, \tan \left (d x + c\right )}{a} + \frac {5 \, \tan \left (d x + c\right ) - 3 i}{a {\left (\tan \left (d x + c\right ) - i\right )}}}{4 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 4.00, size = 73, normalized size = 0.99 \begin {gather*} \frac {5\,\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )}{4\,a\,d}-\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )}{4\,a\,d}-\frac {\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}{a\,d}+\frac {1}{2\,a\,d\,\left (1+\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________